package com.example.demo.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.demo.entity.Admin;
import com.example.demo.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper//指定这是一个操作数据库的mapper
public interface AdminMapper extends BaseMapper<Admin> {
    /**
     * 登录账号
     * @param name
     * @param password
     * @return 返回账号查询结果 0为密码或账号错误，1为账号正确
     */
    @Select("select name,password from admin where name=#{name} and password=#{password}")
    Admin getLogIn(@Param("name") String name, @Param("password") String password);
}
